import {RouterType} from '../types'
import Login from '../page/Login'
import Sigin from '../page/Sigin'
import Home from '../page/Home'

import HomeC from '../page/Home/Home'
import Update from '../page/Home/Update'
import Tb from '../page/Home/Tb'
import Bg from '../page/Home/Table'
import Map from '../page/Home/Map'
import Set from '../page/Home/Set'
import Chat from '../page/Home/Chat'

import {
  HomeOutlined,
  FundOutlined,
  UploadOutlined,
  SendOutlined,
  LineChartOutlined,
  SettingOutlined,
  AliwangwangOutlined
} from '@ant-design/icons';
const routers:RouterType[]=[{
    path:'/',
    element:<Login/>,
    meate:"登录"
},{
    path:'/login',
    element:<Login/>,
    meate:"登录"
},{
    path:'/sigin',
    element:<Sigin/>,
    meate:"注册"
},{
    path:'/home',
    element:<Home/>,
    meate:"主页",
    children:localStorage.getItem('row')=='admin' ? [{
        path:'/home/home',
        element:<HomeC/>,
        meate:"主页",
        key:"1",
        icon:<HomeOutlined />
    },{
        path:'/home/tb',
        element:<Tb/>,
        meate:"图表",
        key:"2",
        icon:<SendOutlined />
    },{
        path:'/home/bg',
        element:<Bg/>,
        meate:"表格",
        key:"3",
        icon:<LineChartOutlined />
    },{
        path:'/home/map',
        element:<Map/>,
        meate:"地图",
        key:"4",
        icon:<FundOutlined />
    },{
        path:'/home/update',
        element:<Update/>,
        meate:"上传",
        key:"5",
        icon:<UploadOutlined />
    },{
        path:"/home/chat",
        element:<Chat/>,
        meate:"聊天",
        key:"6",
        icon:<AliwangwangOutlined />
    },{
        path:'/home/set',
        element:<Set/>,
        meate:"设置",
        key:"7",
        icon:<SettingOutlined />,
    }]:[{
        path:'/home/home',
        element:<HomeC/>,
        meate:"主页",
        key:"1",
        icon:<HomeOutlined />
    },{
        path:'/home/tb',
        element:<Tb/>,
        meate:"图表",
        key:"2",
        icon:<SendOutlined />
    },{
        path:'/home/bg',
        element:<Bg/>,
        meate:"表格",
        key:"3",
        icon:<LineChartOutlined />
    },{
        path:'/home/map',
        element:<Map/>,
        meate:"地图",
        key:"4",
        icon:<FundOutlined />
    },{
        path:'/home/update',
        element:<Update/>,
        meate:"上传",
        key:"5",
        icon:<UploadOutlined />
    }]
}]
export default routers
